﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace e_yayincilik_webproject
{
    public partial class YazarSayfa : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //DBclass.AdminDBTO ad = new DBclass.AdminDBTO();
            //ad=ad.editAdminDBTO(ad,"k");

        }
         /*  Service1 service = new Service1();
        protected void Button1_Click(object sender, EventArgs e)
        {
          MakaleDBTO ne= new MakaleDBTO(string imgName,s);
            string imgName = FileUpload1.FileName.ToString();
            string imgPath = "MAKALE/" + imgName;
            FileUpload1.SaveAs(Server.MapPath(imgPath));
            DBclass.MakaleDBTO makale = new DBclass.MakaleDBTO();
            makale.Makale_Path = imgPath;
            makale.Makale_uzanti = TextBox2.Text;
            makale.MakaleId = TextBox1.Text;
            makale.YazarId = TextBox3.Text;
            if (FileUpload1.PostedFile != null && FileUpload1.PostedFile.FileName != "")
            {
                service.InsertMakale(makale);
                Response.Write("Makale Başarıyla Eklendi!");
            }
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            GridView1.DataSource = service.AllYayinlananMakale();
            GridView1.DataBind();
        }

        protected void Button3_Click(object sender, EventArgs e)
        {
            GridView2.DataSource = service.AllDergi();
            GridView2.DataBind();
        }

        protected void Button4_Click(object sender, EventArgs e)
        {
            string imgName = FileUpload2.FileName.ToString();
            string imgPath = "MAKALE/" + imgName;
            FileUpload1.SaveAs(Server.MapPath(imgPath));
            MakaleDBTO makale = new MakaleDBTO();
            makale.Makale_Path = imgPath;
            makale.Makale_uzanti = TextBox5.Text;
            makale.MakaleId = TextBox4.Text;
            makale.YazarId = TextBox6.Text;
            if (FileUpload1.PostedFile != null && FileUpload1.PostedFile.FileName != "")
            {
                service.UpdateMakale(makale);
                Response.Write("Makale Başarıyla Güncellendi!");
            }
        }

        protected void Button5_Click(object sender, EventArgs e)
        {
            GridView3.DataSource = service.AllYuklenenMakale();
            GridView3.DataBind();
        }

        */
    }
}